from django.urls import path, include
from web.views import account, home, project, statistics

# app_name = 'web'

urlpatterns = [
    # 登录页面
    path('register/', account.register, name='register'),  # "register"
    # 发送短信的ajax请求
    path('send/sms/', account.send_sms, name='send_sms'),  # "send_sms"
    # 注册
    path('register_post/', account.register_post, name='register_post'),
    # 短信登录
    path('login/sms/', account.login_sms, name='login_sms'),
    # 登录
    path('login/sms_post/', account.login_sms_post, name='login_sms_post'),
    # 账户密码登录
    path('login/', account.login, name='login'),
    # 账户密码登录时的验证码
    path('image/code/', account.image_code, name='image_code'),
    # 首页
    path('index/', home.index, name='index'),

    # 退出
    path('logout/', account.logout, name='logout'),
    # 项目管理
    # path('project/list/', project.project_list, name='project_list'),
    # 星标
    # if我创建的项目要星标 project/star/my/1
    # 参与的项目要星标 project/star/join/2
    # path('project/star/(?P<project_type>\w+)/(?P<project_id>)/', project.project_star, name='project_star'),
    # 取消星标
    # path('project/unstar/(?P<project_type>\w+)/(?P<project_id>)/', project.project_unstar, name='project_unstar'),

    # 进入项目管理 【路由分发
    # path('manage/(?P<project_id>\d+)/', include([
    #     path('dashboard/', manage.dashboard, name='dashboard'),
    #     path('issues/', manage.issues, name='issues'),
    #     path('statistics/', manage.statistics, name='statistics'),
    #     path('file/', manage.file, name='file'),
    #     path('wiki/', manage.wiki, name='wiki'),
    #     path('setting/', manage.setting, name='setting'),
    # ], None)),
    # path('manage/(?P<project_id>\d+)/dashboard/', manage.dashboard, name='dashboard'),
    # path('manage/<int:project_id>\/dashboard/', manage.dashboard, name='dashboard'),
    # path('manage/(?P<project_id>\d+)/issues/', manage.issues, name='issues'),
    # path('manage/(?P<project_id>\d+)/statistics/', manage.statistics, name='statistics'),
    # path('manage/(?P<project_id>\d+)/file/', manage.file, name='file'),
    # path('manage/(?P<project_id>\d+)/wiki/', manage.wiki, name='wiki'),
    # path('manage/(?P<project_id>\d+)/setting/', manage.setting, name='setting'),
]

# 进入项目管理
""" 
    path('manage/(?P<project_id>\d+)/dashboard/', account.logout, name='logout'),
    path('manage/(?P<project_id>\d+)/issues/', account.logout, name='logout'),
    path('manage/(?P<project_id>\d+)/statistics/', account.logout, name='logout'),
    path('manage/(?P<project_id>\d+)/file/', account.logout, name='logout'),
    path('manage/(?P<project_id>\d+)/wiki/', account.logout, name='logout'),
    path('manage/(?P<project_id>\d+)/setting/', account.logout, name='logout'),
"""
